/*
 * @ author madman 
 * @ use 文章schema
 */
var mongoose = require("mongoose");
var Schema = mongoose.Schema;
var shortid = require('shortid');
var projectSchema = new Schema({
    // 文章ID
     _id: {
        type: String,
        'default': shortid.generate
    },
    // 专题标题
    name: {
        type: String,
        required: true
    },
    // 专题描述
    describe: {
    	type: String
    },
    // 缩略图
    thumbnail: {
        type: String,
    },
     // 分类id
    categoryId: {
        type: Array,
    },
    // 分类id
    category: {
        type: String,
        ref: 'j_category'
    },
    // 编辑器里的图片
    goodsThumbId: {
        type: String,
        ref: 'j_upload'
    },
    // 内容详情
    content: {
        type: String,
        required: true
    },
    // 新建时间
    createdAt: {
        type: Date,
        default: Date.now
    },
    // 更新时间
    updataAt: {
        type: Date
    }
});
module.exports = mongoose.model('j_project', projectSchema, 'j_project');